import request from '@/utils/request'

// 获取工资表
export function getsalaryslist(data) {
  return request({
    url: '/salarys/list',
    method: 'post',
    data
  })
}
// 查询工资列表
export function getsalarysmoney(userId) {
  return request({
    url: '/salarys/modify/' + userId
  })
}
// 调薪
// 查询工资列表
export function getsalarysmodifypost(data) {
  return request({
    url: `/salarys/modify/${data.userId}`,
    method: 'post',
    data
  })
}
// 获取企业是否设置当月工资
export function getsalarysCompanySetting() {
  return request({
    url: '/salarys/company-settings'
  })
}
// 员工定薪
export function postsalarysinit(data) {
  return request({
    url: '/salarys/init/' + data.userId,
    method: 'POST',
    data
  })
}
// 获取企业计薪及津贴设置
export function getsalaryssettings() {
  return request({
    url: '/salarys/settings'
  })
}
// 保存企业计薪及津贴设置
export function salaryssettingspost(data) {
  return request({
    url: '/salarys/settings',
    method: 'post',
    data
  })
}
// 根据年月查询企业用户薪资列表
export function salarysreportsyearMonth(params) {
  return request({
    url: `/salarys/reports/${params.yearMonth}`,
    params
  })
}
// 构造新月份工资报表
export function newReport(data) {
  return request({
    url: `/salarys/reports/${data.yearMonth}/newReport`,
    method: 'put',
    data
  })
}
// 考勤接口
export function getHistorysData(data) {
  return request({
    url: `/social_securitys/historys/archiveDetail/${data.userId}/${data.yearMonth}`,
    data
  })
}
// 获取考勤详情
export function getAtteArchiveDetail(data) {
  return request({
    url: `/attendances/archive/${data.userId}/${data.yearMonth}`
  })
}
